package com.itic.appbase.framework.xcx.type;
/**
 * 店铺开店状态枚举 
 * @author enne
 *
 */
public enum StoreState {
	close("0","休息中..."),open("1","营业中...");
	
	private String state;
	
	private String name;

	StoreState(String state, String name) {
		this.state = state;
		this.name = name;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	/**
	 * 获取店铺状态
	 * @param state
	 * @return
	 */
	public static  StoreState getStoreState(String state) {
		StoreState StoreState = null;
		switch (state) {
		case "0":
			StoreState = StoreState.close;
			break;
		case "1":
			StoreState =StoreState.open;
		}
		return StoreState;
	}
	/**
	 * 判断店铺是否开店状态
	 * @param state
	 * @return
	 */
	public static boolean isStoreOpen(String state) {
		StoreState storeState =  getStoreState(state);
		if(storeState!=null && storeState.getState().equals(StoreState.open.getState()))
			return true;
		else
			return false;
	}

}